//
//  HMMusic.m
//  MusicPlayer
//
//  Created by 王龙飞 on 15/9/29.
//  Copyright © 2015年 王龙飞. All rights reserved.
//

#import "HMMusic.h"

@implementation HMMusic

+ (instancetype)musicWithDict:(NSDictionary *)dict
{
    id music = [[self alloc] init];
    
    [music setValuesForKeysWithDictionary:dict];
    
    return music;
}

+ (NSArray *)musics {
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Musics.plist" ofType:nil];
    
    NSArray *array = [NSArray arrayWithContentsOfFile:path];
    
    NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:array.count];
    
    for (NSDictionary *dict in array) {
        
       HMMusic *musicM = [HMMusic musicWithDict:dict];
        
        [arrayM addObject:musicM];
    }
    
    return arrayM;
}

@end
